/**
 * MainPanel.java
 * @author pkendzo
 * Email: pkendzo@msn.com
 * 2012
 */
package lu.med.praxiswahl.wahlumed.client.cashbook;

import javax.swing.JPanel;
import javax.swing.JScrollPane;

import java.awt.Font;
import java.awt.SystemColor;

import lu.med.praxiswahl.wahlumed.client.wclient.Main;

/**
 * @author pkendzo
 *
 */
public class TablePanel extends JPanel
{
    
    /**
     * 
     */
    private static final long serialVersionUID = 6995264961077515771L;

    private String panelTitle;
    
    private CashBookDataModel model;
    
    private Main dataManager;

    private CashBookTable table;

    private JScrollPane scrollPane;
    
    
    public TablePanel(String panelTitle, Main dataManager){
	
	super();
	this.setLayout(null);
	this.setBounds(0, 90, 1247, 376);
	
	this.dataManager = dataManager;
	model = new CashBookDataModel(dataManager);
	
	table = new CashBookTable(model, dataManager);
	table.setBackground(SystemColor.window);
	table.setFont(new Font("Verdana", Font.PLAIN, 11));
	this.panelTitle = panelTitle;
	
	scrollPane = new JScrollPane(table);
	this.scrollPane.setBounds(30, 21, 1190, 325);
	this.add(scrollPane);
    }

    /**
     * @return the panelTitle
     */
    public String getPanelTitle()
    {
        return panelTitle;
    }

    /**
     * @param panelTitle the panelTitle to set
     */
    public void setPanelTitle(String panelTitle)
    {
        this.panelTitle = panelTitle;
    }

    /**
     * @return the model
     */
    public CashBookDataModel getModel()
    {
        return model;
    }

    /**
     * @param model the model to set
     */
    public void setModel(CashBookDataModel model)
    {
        this.model = model;
    }

    /**
     * @return the table
     */
    public CashBookTable getTable()
    {
        return table;
    }

    /**
     * @param table the table to set
     */
    public void setTable(CashBookTable table)
    {
        this.table = table;
    }

    
}
